/*
 *  Copyright 2020-2021 Li Fei
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.pengshun.modules.api.transport.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.pengshun.modules.api.coal.validator.First;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @description 货运接单表
 **/
@Data
public class TransportTakeOrderDto     implements Serializable {

    @ApiModelProperty(value = "主键")
    private Long transportTakeOrderId;

    @ApiModelProperty(value = "货运Id")
    @NotNull(message = "id不能为空", groups = {First.class})
    private Long transportId;


    @ApiModelProperty(value = "订单Id")
    private Long orderId;

    @ApiModelProperty(value = "接单人ID")
    private Long userId;

    @ApiModelProperty(value = "运单号")
    private  String transportTakeNo;
    private  String phone;

    private  String carTypeName;

    @ApiModelProperty(value = "接单车辆Id")
    private Long carOwnerId;

    @ApiModelProperty(value = "接单车辆号")
    private String carOwnerNum;

    @ApiModelProperty(value = "默认(1正常，2转运,3取消，4违约)")
    private Integer type;

    @ApiModelProperty(value = "接单方式(1自己，2车主,3运输公司)")
    private Integer takeOrderType;

    @ApiModelProperty(value = "运输公司id")
    private Long transportCompanyId;

    @ApiModelProperty(value = "运输公司名称")
    private String transportCompanyName;
    @ApiModelProperty(value = "车主id")
    private Long ownerUserId;



    @ApiModelProperty(value = "总运费")
    @NotNull(message = "总运费不能为空", groups = {First.class})
    private BigDecimal totalFreight;

    @ApiModelProperty(value = "接取数量")
    @NotNull(message = "接取数量不能为空", groups = {First.class})
    private BigDecimal number;
    private BigDecimal totalNumber;

    @ApiModelProperty(value = "1进行中，2已完成")
    private Integer status;

    @ApiModelProperty(value = "接单时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
    private Date takeTime;


    @ApiModelProperty(value = "运输接单id(类型为2转运才会有)")
    private Long parentId;
    private Long gatheringUserId;
    private String gatheringUserName;
    private String userName;
    private String gatheringUserPhone;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date transportDate;
    @DateTimeFormat(pattern = "HH:mm")
    private Date transportStartTime;
    @DateTimeFormat(pattern = "HH:mm")
    private Date transportEndTime;

    @ApiModelProperty(value = "运费(元/每吨)")
    @NotNull(message = "运费不能为空", groups = {First.class})
    private BigDecimal freight;
    private BigDecimal infoFee;
    private BigDecimal loadFee;
    private BigDecimal unloadFee;
    private BigDecimal poundsFee;
    private BigDecimal otherFee;
}